Optimal. Leaf size=73 \[ -\frac {c^2}{a^2 x}-\frac {(b c-a d)^2}{a^2 b (a+b x)}-\frac {2 c (b c-a d) \log (x)}{a^3}+\frac {2 c (b c-a d) \log (a+b x)}{a^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {90}
\begin {gather*} -\frac {2 c \log (x) (b c-a d)}{a^3}+\frac {2 c (b c-a d) \log (a+b x)}{a^3}-\frac {(b c-a d)^2}{a^2 b (a+b x)}-\frac {c^2}{a^2 x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rubi steps
\begin {align*} \int \frac {(c+d x)^2}{x^2 (a+b x)^2} \, dx &=\int \left (\frac {c^2}{a^2 x^2}+\frac {2 c (-b c+a d)}{a^3 x}+\frac {(-b c+a d)^2}{a^2 (a+b x)^2}-\frac {2 b c (-b c+a d)}{a^3 (a+b x)}\right ) \, dx\\ &=-\frac {c^2}{a^2 x}-\frac {(b c-a d)^2}{a^2 b (a+b x)}-\frac {2 c (b c-a d) \log (x)}{a^3}+\frac {2 c (b c-a d) \log (a+b x)}{a^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.06, size = 67, normalized size = 0.92 \begin {gather*} \frac {-\frac {a c^2}{x}-\frac {a (b c-a d)^2}{b (a+b x)}+2 c (-b c+a d) \log (x)+2 c (b c-a d) \log (a+b x)}{a^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 85, normalized size = 1.16
method | result | size |
default | \(-\frac {a^{2} d^{2}-2 a b c d +b^{2} c^{2}}{a^{2} b \left (b x +a \right )}-\frac {2 c \left (a d -b c \right ) \ln \left (b x +a \right )}{a^{3}}-\frac {c^{2}}{a^{2} x}+\frac {2 c \left (a d -b c \right ) \ln \left (x \right )}{a^{3}}\) | \(85\) |
norman | \(\frac {\frac {\left (a^{2} d^{2}-2 a b c d +2 b^{2} c^{2}\right ) x^{2}}{a^{3}}-\frac {c^{2}}{a}}{x \left (b x +a \right )}+\frac {2 c \left (a d -b c \right ) \ln \left (x \right )}{a^{3}}-\frac {2 c \left (a d -b c \right ) \ln \left (b x +a \right )}{a^{3}}\) | \(87\) |
risch | \(\frac {-\frac {\left (a^{2} d^{2}-2 a b c d +2 b^{2} c^{2}\right ) x}{a^{2} b}-\frac {c^{2}}{a}}{x \left (b x +a \right )}+\frac {2 c \ln \left (-x \right ) d}{a^{2}}-\frac {2 c^{2} \ln \left (-x \right ) b}{a^{3}}-\frac {2 c \ln \left (b x +a \right ) d}{a^{2}}+\frac {2 c^{2} \ln \left (b x +a \right ) b}{a^{3}}\) | \(105\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.32, size = 93, normalized size = 1.27 \begin {gather*} -\frac {a b c^{2} + {\left (2 \, b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} x}{a^{2} b^{2} x^{2} + a^{3} b x} + \frac {2 \, {\left (b c^{2} - a c d\right )} \log \left (b x + a\right )}{a^{3}} - \frac {2 \, {\left (b c^{2} - a c d\right )} \log \left (x\right )}{a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 149 vs.
\(2 (73) = 146\).
time = 0.65, size = 149, normalized size = 2.04 \begin {gather*} -\frac {a^{2} b c^{2} + {\left (2 \, a b^{2} c^{2} - 2 \, a^{2} b c d + a^{3} d^{2}\right )} x - 2 \, {\left ({\left (b^{3} c^{2} - a b^{2} c d\right )} x^{2} + {\left (a b^{2} c^{2} - a^{2} b c d\right )} x\right )} \log \left (b x + a\right ) + 2 \, {\left ({\left (b^{3} c^{2} - a b^{2} c d\right )} x^{2} + {\left (a b^{2} c^{2} - a^{2} b c d\right )} x\right )} \log \left (x\right )}{a^{3} b^{2} x^{2} + a^{4} b x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 173 vs.
\(2 (63) = 126\).
time = 0.39, size = 173, normalized size = 2.37 \begin {gather*} \frac {- a b c^{2} + x \left (- a^{2} d^{2} + 2 a b c d - 2 b^{2} c^{2}\right )}{a^{3} b x + a^{2} b^{2} x^{2}} + \frac {2 c \left (a d - b c\right ) \log {\left (x + \frac {2 a^{2} c d - 2 a b c^{2} - 2 a c \left (a d - b c\right )}{4 a b c d - 4 b^{2} c^{2}} \right )}}{a^{3}} - \frac {2 c \left (a d - b c\right ) \log {\left (x + \frac {2 a^{2} c d - 2 a b c^{2} + 2 a c \left (a d - b c\right )}{4 a b c d - 4 b^{2} c^{2}} \right )}}{a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.52, size = 111, normalized size = 1.52 \begin {gather*} \frac {b c^{2}}{a^{3} {\left (\frac {a}{b x + a} - 1\right )}} - \frac {2 \, {\left (b^{2} c^{2} - a b c d\right )} \log \left ({\left | -\frac {a}{b x + a} + 1 \right |}\right )}{a^{3} b} - \frac {\frac {b^{3} c^{2}}{b x + a} - \frac {2 \, a b^{2} c d}{b x + a} + \frac {a^{2} b d^{2}}{b x + a}}{a^{2} b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.39, size = 101, normalized size = 1.38 \begin {gather*} \frac {4\,c\,\mathrm {atanh}\left (\frac {2\,c\,\left (a\,d-b\,c\right )\,\left (a+2\,b\,x\right )}{a\,\left (2\,b\,c^2-2\,a\,c\,d\right )}\right )\,\left (a\,d-b\,c\right )}{a^3}-\frac {\frac {c^2}{a}+\frac {x\,\left (a^2\,d^2-2\,a\,b\,c\,d+2\,b^2\,c^2\right )}{a^2\,b}}{b\,x^2+a\,x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________